getset
Getset, we're ready to go!
A procedural macro for generating the most basic getters and setters on fields.
Getters are generated as fn field(&self) -> &type
, while setters are generated as fn field(&mut self, val: type)
.
These macros are not intended to be used on fields which require custom logic inside of their setters and getters. Just write your own in that case!
extern crate getset;
Attributes can be set on struct level for all fields in struct as well. Field level attributes take precedence.
extern crate getset;
For some purposes, it's useful to have the get_
prefix on the getters for
either legacy of compatability reasons. It is done with get-prefix
.
extern crate getset;